// ignore_for_file: unnecessary_import, camel_case_types, constant_identifier_names

import 'dart:typed_data';
import 'package:flutter/services.dart';

///主题背景颜色
const Color Color_bg_theme = Color(0xFF050709);

///子视图背景颜色
const Color Color_bg_view = Color(0xFF051418);

///边框颜色
const Color Color_border = Color(0xFF2C6983);

///按钮背景颜色
const Color Color_bg_btn = Color(0xFF0E2D3A);

///按钮选中颜色
const Color Color_select_btn = Color(0xFF4190A1);

///滑块圆点的颜色
const Color Color_thumb_slider = Color(0xFF79A5B2);

///滑块，滑动过的颜色
const Color Color_active_slider = Color(0xFF4190A1);

///滑块，未滑动过的颜色
const Color Color_unActive_slider = Color(0xFF1A3C48);

///分段选择，默认为选中的背景颜色
const Color Color_grey_toggleBtn = Color(0xFF595757);
const Color Color_red_btn = Color(0xFFD5382A);

class assets {
  static const String _basePath = 'assets/images/';

  static String getImagePath(String imageName) {
    return '$_basePath$imageName.png';
  }

  // 定义具体的图片资源
  static const String logo = '${_basePath}logo.png';
  static const String sum = '${_basePath}sum.png';
  static const String sum_select = '${_basePath}sum_select.png';
  static const String eq = '${_basePath}eq.png';
  static const String eq_select = '${_basePath}eq_select.png';
  static const String cross = '${_basePath}cross.png';
  static const String cross_select = '${_basePath}cross_select.png';
  static const String delay = '${_basePath}delay.png';
  static const String delay_select = '${_basePath}delay_select.png';
  static const String color = '${_basePath}color.png';
  static const String color_select = '${_basePath}color_select.png';
  static const String mute_on = '${_basePath}mute_on.png';
  static const String mute_off = '${_basePath}mute_off.png';
  static const String connect = '${_basePath}connect.png';
  static const String connect_dis = '${_basePath}connect_dis.png';
  static const String slider_track = '${_basePath}slider_track.png';
  static const String slider_intrack = '${_basePath}slider_intrack.png';
  static const String car = '${_basePath}car.png';

  static const String soud_b_off = '${_basePath}soud_b_off.png';
  static const String soud_b_on = '${_basePath}soud_b_on.png';
  static const String soud_l_max_off = '${_basePath}soud_l_max_off.png';
  static const String soud_l_max_on = '${_basePath}soud_l_max_on.png';
  static const String soud_l_off = '${_basePath}soud_l_off.png';
  static const String soud_l_on = '${_basePath}soud_l_on.png';

  static const String soud_r_max_off = '${_basePath}soud_r_max_off.png';
  static const String soud_r_max_on = '${_basePath}soud_r_max_on.png';
  static const String soud_r_off = '${_basePath}soud_r_off.png';
  static const String soud_r_on = '${_basePath}soud_r_on.png';

  static const String pass_high = '${_basePath}pass_high.png';
  static const String pass_low = '${_basePath}pass_low.png';

  static const String arrow_left = '${_basePath}arrow_left.png';
  static const String arrow_right = '${_basePath}arrow_right.png';

  static const String alpha = '${_basePath}alpha.png';
  static const String blue = '${_basePath}blue.png';
  static const String green = '${_basePath}green.png';
  static const String lightblue = '${_basePath}lightblue.png';
  static const String pink = '${_basePath}pink.png';
  static const String red = '${_basePath}red.png';
  static const String rgb = '${_basePath}rgb.png';
  static const String white = '${_basePath}white.png';
  static const String yellow = '${_basePath}yellow.png';

  static const String player = '${_basePath}player.png';
  static const String next = '${_basePath}next.png';
  static const String last = '${_basePath}last.png';
  static const String pause = '${_basePath}pause.png';

  ///
  static const String device = '${_basePath}device.png';

  ///读取本地文件
  static Future<Uint8List?> readBinFile(String fileName) async {
    try {
      // 读取 bin 文件
      ByteData data = await rootBundle.load('assets/$fileName');

      // 将 ByteData 转换为 Uint8List 并返回
      return data.buffer.asUint8List();
    } catch (e) {
      print('Error reading bin file: $e');
      return null;
    }
  }
}
